﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;

namespace Chen.IdentityServer4
{
    /// <summary>
    /// SysModule 系统模块表
    ///</summary>
    [SugarTable("SysModule")]
    public class SysModule
    {
        /// <summary>
        /// 菜单ID
        ///</summary>
        [SugarColumn(ColumnName = "ModuleID", IsPrimaryKey = true, IsIdentity = true)]
        public int ModuleID { get; set; }

        /// <summary>
        /// 上级菜单ID
        /// 默认值: ((0))
        ///</summary>
        [SugarColumn(ColumnName = "ParentModuleID")]
        public int ParentModuleID { get; set; }

        /// <summary>
        /// 菜单英文名称 用于匹配前端权限
        ///</summary>
        [SugarColumn(ColumnName = "ModuleName")]
        public string ModuleName { get; set; }
        /// <summary>
        /// 菜单中文名称
        ///</summary>
        [SugarColumn(ColumnName = "ModuleName")]
        public string ModuleNameRemark { get; set; }

        /// <summary>
        /// 菜单编码
        ///</summary>
        [SugarColumn(IsIgnore = true)]
        public string ModuleCode
        { get { return $"{ModuleID}"; }  }

        /// <summary>
        /// 层级
        ///</summary>
        [SugarColumn(ColumnName = "Level")]
        public int Level { get; set; }

        /// <summary>
        /// 排序
        ///</summary>
        [SugarColumn(ColumnName = "SortNum")]
        public int SortNum { get; set; }

        /// <summary>
        /// 路径
        ///</summary>
        [SugarColumn(ColumnName = "PathUrl")]
        public string PathUrl { get; set; }

        /// <summary>
        /// 图标
        ///</summary>
        [SugarColumn(ColumnName = "WebIcon")]
        public string WebIcon { get; set; }
        /// <summary>
        /// 1菜单 2按钮
        /// </summary>
        public int ModuleType { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CreateDate")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "CreateBy")]
        public int CreateBy { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "UpdateDate")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "UpdateBy")]
        public int? UpdateBy { get; set; }

        /// <summary>
        ///
        /// 默认值: ((1))
        ///</summary>
        [SugarColumn(ColumnName = "Status")]
        public bool Status { get; set; }
        /// <summary>
        /// 新增字段  按钮所属的菜单页面 是按钮就有这个字段
        /// </summary>
        public int? ModelMenuID { get; set; }
    }
}